From 820e8097bb10b5b70d73b69a1cc50e3972eda147 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 25 Apr 2005 22:21:26 +0000 Subject: [PATCH] bitkeeper revision 1.1384 (426d6d66A3AfjqSI_9GpheK5U1rydQ) Fix xlvbd_device_alloc to memset() allocated memory correctly. Signed-off-by: Keir Fraser --- linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c index f8aec64938..5097c3a8cc 100644 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c @@ -102,16 +102,16 @@ static struct block_device_operations xlvbd_block_fops = spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED; -static struct lvdisk * xlvbd_device_alloc(void) +static struct lvdisk *xlvbd_device_alloc(void) { - struct lvdisk *ret; + struct lvdisk *disk; - ret = kmalloc(sizeof(struct lvdisk), GFP_KERNEL); - if ( ret ) { - memset(ret, '\0', 0); - INIT_LIST_HEAD(&ret->list); + disk = kmalloc(sizeof(*disk), GFP_KERNEL); + if (disk) { + memset(disk, 0, sizeof(*disk)); + INIT_LIST_HEAD(&disk->list); } - return ret; + return disk; } static void xlvbd_device_free(struct lvdisk *disk) -- 2.30.2